package com.shangdiao.sd_server.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shangdiao.sd_server.dao.mybatis.ExtraMapper;
import com.shangdiao.sd_server.dao.mybatis.SdInternshipMapper;
import com.shangdiao.sd_server.dao.mybatis.SdInternshipReviewMapper;
import com.shangdiao.sd_server.dao.mybatis.SdPInternshipMapper;
import com.shangdiao.sd_server.dao.mybatis.SdPParttimeMapper;
import com.shangdiao.sd_server.dao.mybatis.SdParttimeMapper;
import com.shangdiao.sd_server.dao.mybatis.SdParttimeReviewMapper;
import com.shangdiao.sd_server.generator.pojo.SdInternship;
import com.shangdiao.sd_server.generator.pojo.SdInternshipExample;
import com.shangdiao.sd_server.generator.pojo.SdInternshipReview;
import com.shangdiao.sd_server.generator.pojo.SdInternshipReviewExample;
import com.shangdiao.sd_server.generator.pojo.SdPInternship;
import com.shangdiao.sd_server.generator.pojo.SdPInternshipExample;
import com.shangdiao.sd_server.generator.pojo.SdPParttime;
import com.shangdiao.sd_server.generator.pojo.SdPParttimeExample;
import com.shangdiao.sd_server.generator.pojo.SdParttime;
import com.shangdiao.sd_server.generator.pojo.SdParttimeExample;
import com.shangdiao.sd_server.generator.pojo.SdParttimeReview;
import com.shangdiao.sd_server.generator.pojo.SdParttimeReviewExample;
import com.shangdiao.sd_server.pojo.Row;
import com.shangdiao.sd_server.service.PostService;

@Service(value = "postService")
public class PostServiceImpl implements PostService {
	
    @Autowired
    SdInternshipMapper internshipMapper;
    
    @Autowired
    SdParttimeMapper parttimeMapper;
    
    @Autowired
    SdPInternshipMapper pInternshipMapper;
    
    @Autowired
    SdPParttimeMapper pParttimeMapper;
    
    @Autowired
    ExtraMapper extraMapper;

    @Autowired
    SdParttimeReviewMapper parttimeReviewMapper;
    
    @Autowired
    SdInternshipReviewMapper internshipReviewMapper;
    
	@Override
	public List<SdInternship> selectInternshipList(SdInternshipExample example) {
		return internshipMapper.selectByExample(example);
	}

	@Override
	public List<SdParttime> selectParttimeList(SdParttimeExample example) {
		return parttimeMapper.selectByExample(example);
	}

	@Override
	public List<SdPInternship> selectPInternshipList(SdPInternshipExample example) {
		return pInternshipMapper.selectByExample(example);
	}

	@Override
	public List<SdPParttime> selectPParttimeList(SdPParttimeExample example) {
		return pParttimeMapper.selectByExample(example);
	}

	@Override
	public int countPInternship(SdPInternshipExample example) {
		return pInternshipMapper.countByExample(example);
	}

	@Override
	public int countPParttime(SdPParttimeExample example) {
		return pParttimeMapper.countByExample(example);
	}

	@Override
	public int insertInternship(SdInternship internship) {
		return internshipMapper.insertSelective(internship);
	}

	@Override
	public int insertParttime(SdParttime parttime) {
		return parttimeMapper.insertSelective(parttime);
	}

	@Override
	public SdInternship selectInternship(Integer internshipId) {
		return internshipMapper.selectByPrimaryKey(internshipId);
	}

	@Override
	public SdParttime selectParttime(Integer parttimeId) {
		return parttimeMapper.selectByPrimaryKey(parttimeId);
	}

	@Override
	public List<Row> selectHotPost(Row paramRow) {
		return extraMapper.selectHotPost(paramRow);
	}

	@Override
	public List<SdParttimeReview> selectParttimeReview(SdParttimeReviewExample example) {
		return parttimeReviewMapper.selectByExample(example);
	}

	@Override
	public List<SdInternshipReview> selectInternshipReview(SdInternshipReviewExample example) {
		return internshipReviewMapper.selectByExample(example);
	}

	@Override
	public int countInternship(SdInternshipExample example) {
		return internshipMapper.countByExample(example);
	}

	@Override
	public int countParttime(SdParttimeExample example) {
		return parttimeMapper.countByExample(example);
	}

	@Override
	public SdPInternship selectPInternship(Integer pIId) {
		return pInternshipMapper.selectByPrimaryKey(pIId);
	}

	@Override
	public SdPParttime selectPParttime(Integer pPId) {
		return pParttimeMapper.selectByPrimaryKey(pPId);
	}

	@Override
	public int updateInternship(SdInternship internship) {
		return internshipMapper.updateByPrimaryKeySelective(internship);
	}

	@Override
	public int updateParttime(SdParttime parttime) {
		return parttimeMapper.updateByPrimaryKeySelective(parttime);
	}

	@Override
	public int updatePIntenrship(SdPInternship pInternship, SdPInternshipExample pInternshipExample) {
		return pInternshipMapper.updateByExampleSelective(pInternship, pInternshipExample);
	}

	@Override
	public int updatePParttime(SdPParttime pParttime, SdPParttimeExample pParttimeExample) {
		return pParttimeMapper.updateByExampleSelective(pParttime, pParttimeExample);
	}

	@Override
	public int updateInternship(SdInternship internship, SdInternshipExample internshipExample) {
		return internshipMapper.updateByExampleSelective(internship, internshipExample);
	}

	@Override
	public int updateParttime(SdParttime parttime, SdParttimeExample parttimeExample) {
		return parttimeMapper.updateByExampleSelective(parttime, parttimeExample);
	}

	@Override
	public int updateInternshipReview(SdInternshipReview internshipReview, SdInternshipReviewExample internshipReviewExample) {
		return internshipReviewMapper.updateByExampleSelective(internshipReview, internshipReviewExample);
	}

	@Override
	public int updateParttimeReview(SdParttimeReview parttimeReview, SdParttimeReviewExample parttimeReviewExample) {
		return parttimeReviewMapper.updateByExampleSelective(parttimeReview, parttimeReviewExample);
	}

	@Override
	public int updatePIntenrship(SdPInternship pInternship) {
		return pInternshipMapper.updateByPrimaryKeySelective(pInternship);
	}

	@Override
	public int updatePParttime(SdPParttime pParttime) {
		return pParttimeMapper.updateByPrimaryKeySelective(pParttime);
	}
}
